package mr.ali.video.web.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import mr.ali.video.web.model.Prizes;
import mr.ali.video.web.mapper.PrizesMapper;
import mr.ali.video.web.service.IPrizesService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author Mr-ali
 * @since 2025-09-08
 */
@Service
public class PrizesServiceImpl extends ServiceImpl<PrizesMapper, Prizes> implements IPrizesService {

    @Resource
    private PrizesMapper prizesMapper;

    @Override
    public List<Prizes> getPrizes() {
        QueryWrapper<Prizes> queryWrapper = new QueryWrapper<>();
        return prizesMapper.selectList(queryWrapper);
    }

    @Override
    public Prizes updatePrizes(Prizes prizes) {
        QueryWrapper<Prizes> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("id", prizes.getId());
        prizesMapper.update(prizes, queryWrapper);
        return prizes;
}}

